package de.pierrepoenisch.checkyoursite.client;

import com.google.gwt.user.client.ui.FlexTable;

public class SortableFlexTable extends FlexTable {

	private String[] entryList;
	
	public enum SortDirectionET{
		ascending,
		descending
	}
	
	public SortableFlexTable() {
		super();	
	}
	
	/**
	 * orders the table in sortDirection by column specified with columnNumber. Column
	 * number start by 0. The entries are sorted as strings, not as numbers.
	 * */
	public void sortAsString(int columnNumber, SortDirectionET sortDirection){
		//TODO: implement sorting by strings
		
		
		//read the entries from the table
		entryList = new String[getRowCount()];
		for (int i=0; i<getRowCount(); i++){
			entryList[i]=getText(i, columnNumber);
		}

		
		//Collections.sort(entryList);
		
	}
	
	/**
	 * orders the table in sortDirection by column specified with columnNumber. Column
	 * number start by 0. The entries are sorted as numbers, not as strings.
	 * */
	public void sortAsNumbers(int columnNumber, SortDirectionET sortDirection){
		//TODO: implement sorting by numbers
		
		
	}

	
}
